import { Reducer, Effect, Subscription } from 'umi';

export interface ProjectModelState {
  demo: any;
}

export interface ProjectModelType {
  namespace: 'project';
  state: ProjectModelState;
  effects: {
    insuranceDemo: Effect;
  };
  reducers: {
    save: Reducer<ProjectModelState>;
  };
  subscription: {
    setup: Subscription;
  };
}

const ProjectModel: ProjectModelType = {
  namespace: 'project',
  state: {
    demo: 'demo',
  },
  effects: {
    *insuranceDemo({ payload }, { call, put }) { },
  },
  reducers: {
    save(state, { payload }) {
      return {
        ...state,
        ...payload,
      };
    },
  },
  subscription: {
    setup() { },
  },
};

export default ProjectModel;
